package com.eliza.room.model

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey


/*-*- coding:utf-8 -*-
 * @Author  : debi
 * @Time    : 3/26/22
 * @Software: Android Studio
 */
@Entity(tableName = "Student")
class Student {
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "userId", typeAffinity = ColumnInfo.INTEGER)
    var id: Int = 0

    @ColumnInfo(name = "userName", typeAffinity = ColumnInfo.TEXT)
    lateinit var userName: String

    @ColumnInfo(name = "userAge", typeAffinity = ColumnInfo.INTEGER)
    var userAge: Int = 0

//    @ColumnInfo(name = "userSex", typeAffinity = ColumnInfo.INTEGER)
//    var userSex: Int = 0


    /*
    room  will Ignore this constructor method
     * */
    @Ignore
    constructor(id: Int) {
        this.id = id
    }

    @Ignore
    constructor(userName: String, userAge: Int) {
        this.userName = userName
        this.userAge = userAge
    }

    constructor(id: Int, userName: String, userAge: Int) {
        this.id = id
        this.userName = userName
        this.userAge = userAge
    }


}
